import axios from '~/axios'

export function getCategoryList(){
    return axios.get("/admin/category")
}
export function createCategory(data){
    return axios.post(`/admin/category`,data);
}

export function editCategory(id,data){
    return axios.post(`/admin/category/${id}`,data);
}

export function deleteCategory(id){
    return axios.post(`/admin/category/${id}/delete`);
}

export function upateCategoryStatus(id,status){
    return axios.post(`/admin/category/${id}/update_status`,{status});
}
//获取关联列表
export function getCategoryGoods(id){
    return axios.get(`/admin/app_category_item/list?category_id=${id}`);
}
//删除关联列表
export function deleteCategoryGoods(id){
    return axios.post(`/admin/app_category_item/${id}/delete`);
}
//关联商品
export function setCategoryGoods(data){
    return axios.post(`/admin/app_category_item`,data);
}